package com.tul.exercise.base.innerclass.chapter10_1;

/**
 * @Description 《java编程思想》10.1 示例 1
 *  像普通类一样使用内部类
 **/
public class Parcel1 {
    class Contents {
        private int i = 11;
        public int value() {
            return i;
        }
    }

    class Destination {
        private String label;

        Destination (String label) {
            this.label = label;

        }

        String readLable() {
            return label;
        }
    }


    public void ship(String dest) {
        //像正常类一下使用内部类
        Contents c = new Contents();

        Destination d = new Destination(dest);
        System.out.println(d.readLable());
    }

    public static void main(String[] args) {
        Parcel1 p = new Parcel1();
        p.ship("Tasmania");
    }
}




















